package com.firstclass.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.firstclass.entity.TakescoreEntity;
import com.firstclass.entity.TakescoreEntity;
import com.firstclass.service.TakescoreService;
import com.firstclass.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-12-24 13:56:59
 */
@RestController
@RequestMapping("back/takescore")
public class TakescoreController {
    @Autowired
    private TakescoreService takescoreService;

    /**
     * 查
     */
    @GetMapping("find_takescore")
    public String findTakeCourse(String name, String num, String course) {
        return R.ok(takescoreService.queryByCondition(name, num, course));
    }


    /**
     * 增，改
     */
    @PostMapping("save_takescore")
    public String saveCourse(@RequestBody TakescoreEntity takescoreEntity) {
        takescoreService.save(takescoreEntity);
        return R.ok();
    }

    /**
     * 删
     */
    @PostMapping("del_takescore")
    public String batchDel(@RequestBody List<Integer> ids) {
        takescoreService.removeByIds(ids);
        return R.ok();
    }

}
